package com.heima.feign.wemedia;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.common.wemedia.pojo.WmNews;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient("leadnews-wemedia")
public interface Wemedia {
    /**
     * 查询自媒体文章状态为8，并且发布时间小于当前时间的文章
     */
    @PostMapping("/api/v1/news/findEnableNews")
    public ResponseResult<List<WmNews>> findEnableNews();

    @PostMapping("/api/v1/news/publish")
    public ResponseResult publish(@RequestBody WmNews wmNews);

    @GetMapping("/api/v1/news/getId/{id}")
    public ResponseResult<WmNews> getId(@PathVariable Integer id);

}
